//
//  JobSelectedViewController.m
//  1gene
//
//  Created by 1jiyin on 16/3/31.
//  Copyright © 2016年 1jiyin. All rights reserved.
//

#import "JobSelectedViewController.h"

@interface JobSelectedViewController ()

@end

@implementation JobSelectedViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:[UIView new]];
    [self createNavigation];
    [self createUI];
}
-(void)createUI
{
    JobSelectedTableView *table=[[JobSelectedTableView alloc]initWithFrame:CGRectMake(0, 20+44, self.view.frame.size.width, self.view.frame.size.height-20-44) style:UITableViewStylePlain];
    table.jobSelected=^(NSString *str){
        NSLog(@"==============%@",str);
        self.returnjobSelected(str);
        self.navigationController.navigationBar.hidden=YES;
        [self.navigationController popViewControllerAnimated:YES];
    };
    [self.view addSubview:table];
}
-(void)createNavigation
{
    self.navigationController.navigationBar.hidden=NO;
    self.navigationController.navigationBar.barTintColor=[UIColor colorWithRed:84/255.0 green:199/255.0 blue:222/255.0 alpha:1];
    //返回
    UIButton *leftBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    leftBtn.frame=CGRectMake(0, 0, 25, 25);
    [leftBtn setBackgroundImage:[UIImage imageNamed:@"left_back"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(leftBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithCustomView:leftBtn];
    
    //标题
    UILabel *title=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 44)];
    title.text=@"行业选择";
    title.font=[UIFont systemFontOfSize:22];
    title.textAlignment=NSTextAlignmentCenter;
    title.textColor=[UIColor whiteColor];
    self.navigationItem.titleView=title;
    
}
//返回上一页
-(void)leftBtnClick:(UIButton *)sender
{
    self.navigationController.navigationBar.hidden=YES;
    [self.navigationController popViewControllerAnimated:YES];
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
